<template>
    <div>
        <van-address-list v-model="chosenAddressId" :list="list" :disabled-list="disabledList" add-button-text="提交订单"
            default-tag-text="默认" @add="onAdd" @edit="onEdit" />
        <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg">
            <template #tags>
                <van-tag plain type="primary">标签</van-tag>
                <van-tag plain type="primary">标签</van-tag>
            </template>
            <template #footer>
                <van-button size="mini">按钮</van-button>
                <van-button size="mini">按钮</van-button>
            </template>
        </van-card>
          <van-cell-group inset>
            <van-cell title="优惠券" value="无可用优惠券" />
            <van-cell title="店铺优惠" value="无" />
            <van-cell title="商品金额" value="￥60.30000000004" />
            <van-cell title="优惠金额" value="0" />
            <van-cell title="运费" value="免运费" />
            <van-cell title="备注" value="123123" />
        </van-cell-group>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { payApi } from '@/api/api';
const chosenAddressId = ref('1');
const list = [
    {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
    },
];
const onEdit = (item, index) => showToast('编辑地址:' + index);
const onAdd = () =>
{
      let obj = ([
        {
            orderId: '123',
            subject: '123',
            totalPrice: '123'
        }
    ])
      payApi(obj).then(res => {
        window.open(res.data.data)
    })
}
</script>

<style lang="scss" scoped></style>